
CC = gcc

SDK_DIR = ./aliyun-iot-device-sdk-c-2017-01-24

INCLUDE_DIRS = -I $(SDK_DIR)/include/ccp
INCLUDE_DIRS += -I $(SDK_DIR)/common/inc/
INCLUDE_DIRS += -I $(SDK_DIR)/platform/linux/inc/

CFLAGS = -g -Wall $(INCLUDE_DIRS)

LIB_DIRS = -L $(SDK_DIR)

LDFLAGS = $(LIB_DIRS) -liotsdk -lm -lpthread -luci

TARGET = main.o demo.o

all: test

test : ${TARGET}
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

demo.o:
	$(CC) $(CFLAGS) -c demo.c 
.SUFFIXES: .c .o
.c.o:
	$(CC) -c -o $@ $^
.PHONY:clean
clean:
	rm -f rbcfg *.o test
